import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import axios from 'axios'

// 配置Axios默认值
axios.defaults.timeout = 10000
axios.interceptors.request.use(config => {
  console.log('发送请求:', config)
  return config
})
axios.interceptors.response.use(
  response => {
    console.log('接收响应:', response)
    return response
  },
  error => {
    console.error('请求错误:', error)
    return Promise.reject(error)
  }
)

const app = createApp(App)

app.use(createPinia())
app.use(router)
app.use(ElementPlus)

app.mount('#app')